package host

import (
	"context"
	core "go-step/s9_cmdb/api/db"
	"go-step/s9_cmdb/api/models"
)

func SaveHost(_ context.Context, host *models.Host) error {
	db := core.GetDB()
	err := db.Create(host).Error
	return err
}

func QueryHost() ([]models.Host, error) {
	db := core.GetDB()
	var hosts = make([]models.Host, 0)
	err := db.Find(&hosts).Error
	return hosts, err
}

func UpdateHost(context.Context, *models.Host) (*models.Host, error) {
	return &models.Host{}, nil
}
func DeleteHost(context.Context, *QueryHostRequest) (*models.Host, error) {
	return &models.Host{}, nil
}
